import java.util.Random;
import java.util.Scanner;

public class Test {
    public static int add(int a,int b){
        //方法的重载
        return a+b;
    }
    public static int add(int a,int b,int c){
        //方法的重载
        return a+b;
    }
    public static double add(double a,double b){
        return a+b;
    }


    public static void main14(String[] args) {
        int x = 10;
        int y = 20;
        int sun1 = add(x,y);
        System.out.println(sun1);
        double d1 = 12.1;
        double d2 = 18.3;
        double sum2 = add(d1,d2);
        System.out.println(sum2);
        }

    public static void main13(String[] args) {
        int a = 10;
        int b = 20;
        swap(a,b);
    }
    public static void swap(int x,int y){
        int tmp = x;
        x = y;
        y = tmp;
        System.out.println(""+x+" "+y);
    }

    public static int fac(int n){
        //求n的阶乘
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret *= i;
        }
        return ret;
    }


    public static int facSum(int k) {
        //求从1至k的阶乘
        int sum = 0;
        for (int i = 1; i <= k; i++) {
            sum += fac(i);
        }
        return sum;
    }
    public static void main12(String[] args) {
        System.out.println(facSum(5));//调用方法
    }
    public static void main11(String[] args) {
        //输入一个整数，输出其各个数位的数字
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        while (n != 0){
            System.out.println(n%10);
            n /= 10;
        }
    }
    public static void main10(String[] args) {
        int n = 7;
        for (int i = 31;i >= 0;i-=2){//int占4个字节，有32位，最左边为符号位
            System.out.print(((n >>> i) & 1)+" ");
        }
        System.out.println();
        for (int i = 30; i >= 0 ; i-=2) {
            System.out.print(((n >>> i)&1)+" ");
        }
    }
    public static void main9(String[] args) {
        //计算二进制的1的个数
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count = 0;
        while (n != 0){
            count++;
            n = n&(n-1);
        }
        System.out.println(count);
    }
    public static void main8(String[] args) {
        //水仙花
        for (int i = 0; i < 999999; i++) {
            int count = 0;
            int tmp = i;
            while (tmp != 0){//计算tmp是几位数
                count++;
                tmp = tmp/10;
            }
            int sum = 0;
            tmp = i;
            while (tmp != 0){//计算是否是水仙花数
                sum += Math.pow(tmp%10,count);
                tmp /= 10;
            }
            if (sum == i){
                System.out.println(i);
            }
        }
    }
    public static void main7(String[] args) {
//        int i = 4;
//        int j = 5;
//        System.out.println(n*m);
        System.out.print("aaaaa\tbbbbbbb");
    }
    public static void main6(String[] args) {
        //乘法表
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print("\t"+j+"*"+i+ "=" +j*i);
            }
            System.out.println();
        }
    }
    public static void main5(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int count = 3;
        while (count != 0) {
            System.out.println("请输入你的密码，你还有" + count + "次机会");
            String password = scanner.nextLine();
            if (password.equals("1234")) {
                System.out.println("登录成功");
                break;
            } else {
                System.out.println("密码错误");
                count--;//关键
            }
        }
        if (count == 0)
        System.out.println("账号锁定，你已无法输入密码");
    }
    public static void main4(String[] args) {
        //猜数字游戏
        Random in = new Random();
        int a = in.nextInt(100);
        System.out.println(a);
        Scanner on = new Scanner(System.in);
        while (true) {
            int b = on.nextInt();
            if (b > a) {
                System.out.println("猜大了");

            } else if (b < a) {
                System.out.println("猜小了");
            } else {
                System.out.println("猜对了");
                break;
            }
        }
    }
    public static void main3(String[] args) {
        //输入x图形
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()){
            int a = in.nextInt();
            for (int i = 0; i < a; i++) {
                for (int j = 0; j < a; j++) {
                    if (i == j || (i+j) == a-1){
                        System.out.print("*");//一行输出完了后换行
                    }else {
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
        }
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入你的年龄：");
        int age = sc.nextInt();
        sc.nextLine();
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的大名：");
        String daming = sc.nextLine();
        System.out.println("请输入你的工资：");
        float salary = sc.nextFloat();






       // sc.nextLine();

        System.out.println("你的信息如下：");
        System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
        sc.close(); // 注意, 要记得调用关闭方法
    }
    public static void main1(String[] args) {
        //计算分数和
        double sum = 0;
        int flg = 1;
        for (int i = 1; i <= 100 ; i++) {//将分母表达出来
            sum = sum + 1.0/i * flg;
            flg = -flg;//实现正负数交替
        }
        System.out.println(sum);

    }
}
